import {reactive} from "vue";

const userInfrmationRules = reactive({
    userName: [
        {required: true, message: '请输入用户名', trigger: 'blur'},
        {min: 3, max: 20, message: '用户名的长度介于3至20位', trigger: 'blur'},
    ],
    nickName: [
        {required: true, message: '请输入昵称', trigger: 'blur'},
        {min: 3, max: 20, message: '昵称的长度介于3至20位', trigger: 'blur'},
    ],
    signature: [
        {required: false, message: '请输入个人签名', trigger: 'blur'},
        {min: 3, max: 20, message: '签名的长度介于3至50位', trigger: 'blur'},
    ],
    tel: [
        {required: false, message: '请输入个人电话', trigger: 'blur'},
    ],
    email: [
        {required: true, message: '请输入个人邮箱', trigger: 'blur'},
    ],
    age: [
        {required: false, message: '请输入年龄', trigger: 'blur'},
    ],
})

const loginFormRules = reactive({
    userName: [
        {required: true, message: '请输入用户名', trigger: 'blur'},
        {min: 4, max: 20, message: '用户名长度介于4位到20位之间', trigger: 'blur'},
    ],
    password: [
        {required: true, message: '请输入密码', trigger: 'blur'},
        {min: 4, max: 20, message: '密码长度介于4位到20位之间', trigger: 'blur'},
    ],
    code: [
        {required: true, message: '请输入验证码', trigger: 'blur'},
        {length: 4, message: '验证码长度介于4位到20位之间', trigger: 'blur'},
    ],
})


export const businessRegisteryRules = reactive({
    userName: [
        {required: true, message: '请输入用户名', trigger: 'blur'},
        {min: 4, max: 20, message: '用户名长度介于4位到20位之间', trigger: 'blur'},
    ],
    password: [
        {required: true, message: '请输入密码', trigger: 'blur'},
        {min: 4, max: 20, message: '密码长度介于4位到20位之间', trigger: 'blur'},
    ],
    phone: [
        {required: true, message: '请输入手机号', trigger: 'blur'},
        {min: 4, max: 20, message: '手机号格式,不合规', trigger: 'blur'},
    ],
    address: [
        {required: true, message: '请输入地址', trigger: 'blur'},
        {min: 4, max: 20, message: '地址长度介于4位到20位之间', trigger: 'blur'},
    ],
    name: [
        {required: true, message: '请输入店铺名称', trigger: 'blur'},
        {min: 4, max: 20, message: '店铺名称长度介于4位到20位之间', trigger: 'blur'},
    ],
    cover: [
        {required: true, message: '请选择店面封面', trigger: 'blur'},
    ],
})

export {
    userInfrmationRules, loginFormRules
}